﻿// <copyright file="NavigationServiceExtensions.cs" company="Edge Extensions Project">
// Copyright (c) 2009 All Rights Reserved
// </copyright>
// <author>Kevin Nessland</author>
// <email>kevinnessland@gmail.com</email>
// <date>2009-07-08</date>
// <summary>Contains NavigationService-related extension methods.</summary>
namespace Edge.Extensions.Wpf
{
    using System.Windows.Navigation;

    /// <summary>
    /// Provides various NavigationService-related extensions.
    /// </summary>
    public static class NavigationServiceExtensions
    {
        /// <summary>
        /// Removes all back entries from a NavigationService.
        /// </summary>
        /// <param name="service">Service to remove back entries from.</param>
        public static void RemoveAllBackEntries(this NavigationService service)
        {
            while (service.CanGoBack)
            {
                service.RemoveBackEntry();
            }
        }
    }
}
